const mongoose = require('mongoose')
// 连接数据库
mongoose.connect('mongodb://127.0.0.1:27017/my_db')

const conn = mongoose.connection

conn.on('query', () => {
  console.log('连接成功')
})
conn.on('error', (err) => {
  console.log('连接失败' + err)
})

module.exports = mongoose